<?php 
    $content=LoadConfig::$content;
    $url= new Url();
    $current_url = Common::getCurrentUrl();
    $path_paging = strpos($current_url,'?') !==false ? $current_url.'&' : $current_url.'?';
    $path_paging = str_replace("?page=".$page."&","?",$path_paging);
    $path_paging = str_replace("&page=".$page."&","&",$path_paging);
?>
<div class="main clearfix">
    <div class="Tabs clearfix">
        <ul class="clearfix">
            <li><a href="<?php echo Url::createUrl("customerCare/index"); ?>" ><span>Báo lỗi</span></a></li>
            <li><a href="<?php echo Url::createUrl("customerCare/logsms"); ?>"><span>Log Sms</span></a></li>
            <li><a href="<?php echo Url::createUrl("customerCare/logcard"); ?>" class="active"><span>Log Card</span></a></li>
        </ul>                
    </div>
    <div class="box clearfix bottom30">
    <form action="" method="get">
        <ul class="form4">
            <li class="clearfix"><label><strong>Từ ngày </strong>:</label>
                <div class="filltext">
                    <?php
                        $this->widget(
                        "zii.widgets.jui.CJuiDatePicker"
                        , array(
                        "name"=>"from_date"
                        , "id"=>"from_date"
                        , "value"=>$from_date                                                                
                        , "options"=> array(
                        'showAnim' => 'fold'
                        , 'dateFormat' => 'dd-mm-yy'
                        , 'changeYear' => 'true'
                        , 'changeMonth' => 'true'
                        , 'showOn' => 'both'
                        , 'buttonText' => '<input type="button" name="" value="" class="ic-date">'
                        )
                        , 'htmlOptions' => array(
                        'style' => 'width:170px'
                        , 'class' => 'form'
                        )
                        )
                        );
                    ?>                                       
                    &nbsp;đến ngày &nbsp; 
                    <?php
                        $this->widget(
                        "zii.widgets.jui.CJuiDatePicker"
                        , array(
                        "name"=>"to_date"
                        , "id"=>"to_date"
                        , "value"=>$to_date
                        , "options"=> array(
                        'showAnim' => 'fold'
                        , 'dateFormat' => 'dd-mm-yy'
                        , 'changeYear' => 'true'
                        , 'changeMonth' => 'true'
                        , 'showOn' => 'both'
                        , 'buttonText' => '<input type="button" name="" value="" class="ic-date">'
                        )
                        , 'htmlOptions' => array(
                        'style' => 'width:170px'
                        , 'class' => 'form'
                        )
                        )
                        );
                    ?>
                </div>
            </li>
             <li class="clearfix"><label><strong>Tài khoản </strong>:</label>
             <input name="name_search" type="text" value="<?php  if(isset($name_search)){echo $name_search; } ?>" style="width:197px;margin-right:28px">
             </li>
            <li class="clearfix"><label><strong>Từ khóa </strong>:</label>
                <div class="filltext">
                    <input name="keyword" type="text" value="<?php  if(isset($keyword)){echo $keyword; } ?>" style="width:197px;margin-right:28px"> Theo &nbsp
                    <select name="search_type" style="width:120px; height: 23px;">
                        
                        <option value="3" <?php if(isset($search_type) && $search_type==3){ echo "selected=selected";} ?>> -- Card Serie--</option>
                        <option value="4" <?php if(isset($search_type) && $search_type==4){ echo "selected=selected";} ?>> -- Nhà SX--</option>
                        <option value="5" <?php if(isset($search_type) && $search_type==5){ echo "selected=selected";} ?>> -- Sản Phẩm--</option>
                    </select>
                </div>
            </li>
            
            <li class="clearfix"><label>&nbsp;</label>
                <div class="filltext">
                    <input type="submit" class="btn-bigblue" value=" Tìm kiếm"> 
                </div>
            </li>
        </ul>
        </form>
    </div>
    <div class="box">
        <div class="fillter clearfix">
            <div class="fl">Tìm thấy <strong class="clred"><?php echo $count; ?></strong> kết quả trong <strong class="clred"><?php echo $max_page; ?></strong> trang</div>
            <div class="fr">
                <a class="excel" href="#"><strong>Xuất ra file excel</strong></a>
                <ul class="paging">
                    <?php echo Paging::show_paging_cp($max_page,$page,$path_paging); ?>
                </ul>
            </div>
        </div>
        <div class="table clearfix">
            <table width="100%" cellspacing="0" cellpadding="0" border="0">
                <tbody>
                    <tr class="bg-grey">
                        <!--<td width="4%" ><strong>STT</strong></td>-->
                        <td width="8%"><strong>Tài khoản </strong></td>
                        <td width="5%"><strong>RefCode </strong></td>
                        <td width="5%" ><strong>Nhà SX</strong></td>
                        <td width="17%" ><strong>Sản phẩm</strong></td>
                        <td width="5%" ><strong>Loại Card</strong></td>
                        <td width="5%" ><strong>Card Serie</strong></td>
                        <td width="5%" ><strong>Mệnh giá</strong></td>
                        <td width="5%" ><strong>Tỉ lệ cho wap</strong></td>
                        <td width="5%" ><strong>Doanh thu thanh viên</strong></td>
                        <td width="13%" ><strong>Thời gian</strong></td>
                    </tr>
                    
                    <?php foreach($data as $key=>$value){ ?>
                    <tr>
                        <td  style="color: blue;text-align:center"><b><?php echo $username[$key]['username']; ?></b></td>
                        <td class="text-left" >
                            <?php echo $username[$key]['refCode'];?>
                        </td>
                        <td class="text-left" style="color: blue;">
                        <b><?php echo $partner[$key]['name']; ?> </b>
                        </td>
                        <td class="text-left" style="color: blue"><b><?php echo $game[$key]['title']; ?></b></td>
                        <td class="text-left"><?php echo $value['provider_code']; ?></td>
                        <td class="text-right"><?php echo $value['card_seri']; ?></td>
                        <td class="text-right"><?php echo Common::format_price($value['price']); ?></td>
                        <td class="text-right"><?php echo $value['percent_wapmaster'] ?></td>
                        <td class="text-right"><?php echo Common::format_price(round($money_wap[$key])); ?></td>
                        <td class="text-right"><?php echo date("H:i:s d-m-Y",$value['create_date']); ?></td>
                    </tr>
                    <?php }?>
                </tbody>
            </table>
        </div>
        <div class="fillter clearfix">
            <div class="fr">
                <ul class="paging">
                    <?php echo Paging::show_paging_cp($max_page,$page,$path_paging); ?>
                </ul>
            </div>
        </div>

    </div>
        </div>
                        
                 